/**
 * Tables
 */

$am-table-background: #fff !default;
$am-table-border-color: am-color(divider);

@mixin am-table {
  background: $am-table-background;
  width: 100%;
  word-break: break-word;
}

@mixin am-table-header {
  border-bottom: 1px solid $am-table-border-color;
  display: flex;
  padding: am-unit(2);
}

@mixin am-table-column-heading {
  @include am-color(secondary-text);
  @include am-font-size(13px);
  border-bottom: 1px solid $am-table-border-color;
  font-weight: $am-font-weight-semi-bold;
  height: am-unit(6);
  line-height: am-unit(2);
  padding: am-unit(1) am-unit(2);
  text-align: left;
  white-space: nowrap;
}

@mixin am-table-sort {
  position: relative;

  &:after {
    border: 5px solid transparent;
    margin-left: $am-unit-type;
    content: "";
    margin-top: -1.5px;
    position: absolute;
    top: 50%;
    right: -15px;
    width: 0;
    height: 0;
  }
}

@mixin am-table-sort-asc {
  &:after {
    border-bottom-color: am-color(primary);
    margin-top: -7.5px;
  }
}

@mixin am-table-sort-desc {
  &:after {
    border-top-color: am-color(primary);
  }
}

@mixin am-table-row {
  height: am-unit(6);
  transition: 0.12s background;
}

@mixin am-table-row-hover {
  background: #eee;

  td,
  th {
    box-shadow: 0 -1px 0 rgba(#000, 0.05);
    border-bottom: 1px solid darken($am-table-border-color, 5%);
  }
}

@mixin am-table-row-selected {
  background: #e0e0e0;

  td,
  th {
    box-shadow: 0 -1px 0 rgba(#000, 0.15);
    border-bottom: 1px solid darken($am-table-border-color, 15%);
  }
}

@mixin am-table-cell {
  @include am-color(text);
  @include am-font-size(13px);
  border-bottom: 1px solid $am-table-border-color;
  font-weight: $am-font-weight-regular;
  padding: am-unit(1) am-unit(2);

  img {
    display: block;
    height: auto;
    max-width: 320px;
    width: 100%;
  }
}

@mixin am-table-cell-selectable {
  padding: am-unit(2) am-unit(3) am-unit(2);
  width: 18px + am-unit(6);

  [type=checkbox] {
    display: inline-block;
    height: 18px;
    margin: 0;
    vertical-align: middle;
    width: 18px;
  }
}

@mixin am-table-cell-actions {
  background: asset_url("active_material/icons/more.svg") 25% 50% no-repeat;
  position: relative;
  width: am-unit(6);
}
